import { deleteHttp, getHttp, postHttpJSON } from "./index";

// 轮播接口
export const getBanners = () => getHttp("/health/share/v1/bannersShow");
// 问诊咨询接口 | 常见病症接口
export const getKnowledgeBase = () =>
    getHttp("/health/share/knowledgeBase/v1/findDepartment");
// 健康咨询标题接口
export const getInformation = () =>
    getHttp("/health/share/information/v1/findInformationPlateList");
// 健康咨询请求列表查询类型
interface InfoListParamsRawState {
    plateId: number;
    count: number;
    page: number;
}
// 健康咨询列表接口
export const getInformationListById = (params: InfoListParamsRawState) =>
    getHttp("/health/share/information/v1/findInformationList", params);
// 健康咨询详情接口
export const getInformationListDetail = (infoId: string) => {
    return getHttp('/health/share/information/v1/findInformation', { infoId })
}

// 咨询收藏取消
export const cancelInfoCollection = (infoId: number) => {
    return deleteHttp('/health/user/verify/v1/cancelInfoCollection?infoId=' + infoId)
}
// 咨询收藏
export const addInfoCollection = (infoId: number) => {
    return postHttpJSON('/health/user/verify/v1/addInfoCollection?infoId=' + infoId)
}


// 咨询分享


// 常见病症接口根据课室查询
export const getKnowledgeBaseListByID = (departmentId: number) =>
    getHttp("/health/share/knowledgeBase/v1/findDiseaseCategory", {
        departmentId,
    });
// 常见病症接口根据课室查询
export const getKnowledgeBaseDetailByID = (id: number) =>
    getHttp("/health/share/knowledgeBase/v1/findDiseaseKnowledge", {
        id,
    });
// 常见药品标题
export const getKnowledgeBaseCategoryList = () =>
    getHttp("/health/share/knowledgeBase/v1/findDrugsCategoryList");

interface CategoryListParams {
    drugsCategoryId: number;
    page?: number;
    count?: number;
}
// 常见药品内容
export const getKnowledgeBaseCategoryListItemsByID = (
    params: CategoryListParams
) => getHttp("/health/share/knowledgeBase/v1/findDrugsKnowledgeList", params);

// 常见药品详情
export const getKnowledgeBaseCategoryDetailById = (
    id: number
) => getHttp("/health/share/knowledgeBase/v1/findDrugsKnowledge", { id });


// 首页搜索
export const getSearchByKeyWord = (
    keyWord: string
) => getHttp("/health/share/v1/homePageSearch", { keyWord });

// 热门搜索
export const getHotSearch = () => getHttp("/health/share/v1/popularSearch");
